<%@page import="com.soft.entity.Student"%>
<%@ page language="java" import="java.util.List" pageEncoding="utf-8"%>
<%@ page import="com.soft.dao.StudentDao"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>按学号搜索学生</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    
  </head>

  <body>
    <h2>按学号搜索学生</h2>
      <form action="StudentSearchServlet" method="post" role="from">
            <input type="text" name="stuno" placeholder="学号">
            <button type="submit" >提交</button>
      </form>
       <table border="1">
    <tr>
        <th>ID</th>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>操作</th>
    </tr>
  	  <%
		Student s=(Student)request.getAttribute("students");
        if (s != null ) {
    %>
    <tr>
        <td><%= s.getId() %></td>
        <td><%= s.getStuno() %></td>
        <td><%= s.getName() %></td>
        <td><%= s.getGender() %></td>
        <td><%= s.getAge() %></td>
        <td>
            <a href="StudentDelServlet?id=<%= s.getId() %>">删除</a>
            <a href="StudentUpdServlet?id=<%= s.getId() %>">修改</a>
        </td>
    </tr>
    <%
            
        } else {
    %>
    <tr>
        <td colspan="6">未找到相关学生信息。</td>
    </tr>
    <%
        }
    %>
</table>
  </body>
</html>